package com.lrkj.payfee.service.impl;

import java.util.List;
import com.lrkj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lrkj.payfee.mapper.HandReceiptMapper;
import com.lrkj.payfee.domain.HandReceipt;
import com.lrkj.payfee.service.IHandReceiptService;

/**
 * 交班收款明细Service业务层处理
 *
 * @author yajun_ren
 * @date 2022-03-31
 */
@Service
public class HandReceiptServiceImpl implements IHandReceiptService
{
    @Autowired
    private HandReceiptMapper handReceiptMapper;

    /**
     * 查询交班收款明细
     *
     * @param id 交班收款明细ID
     * @return 交班收款明细
     */
    @Override
    public HandReceipt selectHandReceiptById(String id)
    {
        return handReceiptMapper.selectHandReceiptById(id);
    }

    /**
     * 查询交班收款明细列表
     *
     * @param handReceipt 交班收款明细
     * @return 交班收款明细
     */
    @Override
    public List<HandReceipt> selectHandReceiptList(HandReceipt handReceipt)
    {
        return handReceiptMapper.selectHandReceiptList(handReceipt);
    }

    /**
     * 新增交班收款明细
     *
     * @param handReceipt 交班收款明细
     * @return 结果
     */
    @Override
    public int insertHandReceipt(HandReceipt handReceipt)
    {
        handReceipt.setCreateTime(DateUtils.getNowDate());
        return handReceiptMapper.insertHandReceipt(handReceipt);
    }

    /**
     * 修改交班收款明细
     *
     * @param handReceipt 交班收款明细
     * @return 结果
     */
    @Override
    public int updateHandReceipt(HandReceipt handReceipt)
    {
        handReceipt.setUpdateTime(DateUtils.getNowDate());
        return handReceiptMapper.updateHandReceipt(handReceipt);
    }

    /**
     * 批量删除交班收款明细
     *
     * @param ids 需要删除的交班收款明细ID
     * @return 结果
     */
    @Override
    public int deleteHandReceiptByIds(String[] ids)
    {
        return handReceiptMapper.deleteHandReceiptByIds(ids);
    }

    /**
     * 删除交班收款明细信息
     *
     * @param id 交班收款明细ID
     * @return 结果
     */
    @Override
    public int deleteHandReceiptById(String id)
    {
        return handReceiptMapper.deleteHandReceiptById(id);
    }

    @Override
    public int deletehandRecordId(String handRecordId) {
        return handReceiptMapper.deletehandRecordId(handRecordId);
    }

    /**
     * 批量新增交班收款明细信息
     *
     * @param handReceipts 交班收款明细对象
     */
    public int batchAddData(List<HandReceipt> handReceipts)
    {
           return handReceiptMapper.batchAddData(handReceipts);
    }
}
